<template>
	<view  class="contents" :style="'height:'+screenHeight+'px;'">
		<view class="shows">
			<view class="list" v-for="(doctor,index) in doctorlist" :key="index" @click="qh(doctor.DepartmentId)">
					
					<view class="lista">
						<span class="name">{{doctor.DptName}}</span>
						<view><u-icon name="arrow-right"></u-icon></view>
					</view>
			</view>
			<view class="" style="margin-top: 20rpx;">
				<span @click="getlist"><u-loadmore :status="status" /></span>
				
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				status: 'loadmore',
				page: 1,
				rows: 20,
				screenHeight: getApp().globalData.screenHeight,
				doctorlist: [],
				keyword:''
			}
		},
		onLoad(){
				this.Search()
		},
		onReachBottom() {
			this.getlist()
		},
		onPullDownRefresh() {
			this.Search()
			setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 800);
		},
		methods: {
			qh(e){
				uni.navigateTo({
					url: `/pages/zhuyaun/ksjs/ksjsxq?id=${e}`,
				})
			},
			Search(){
				this.$request('DutyRecord', 'list', {
					page: this.page,
					rows: this.rows,
					KeyValue:this.keyword
				}).then(res => {
					console.log("科室列表",res)
					let doctor = res.data.rows
					if (doctor.length > 0) {
						this.doctorlist = doctor
						this.status = "loadmore"
					}
					if (doctor.length % 6 > 0) {
						this.status = "nomore"
					}
					console.log(this.doctorlist)
				})
			},
			getlist() {
				this.rows += 6
				this.status = "loading"
					this.Search()
				
			}
		}

	}
</script>

<style>
	@import './charge.css'
</style>


<style lang="scss" scoped>
	.wrap {
		padding: 24rpx;
	}

	.item {
		padding: 24rpx 0;
		color: $u-content-color;
		font-size: 28rpx;
	}
</style>